package com.haoshuang.zhouzhoubang.ui.activity

import android.os.Bundle
import com.haoshuang.zhouzhoubang.databinding.ActivityYueEeBinding
import com.haoshuang.zhouzhoubang.ui.vm.YueEeViewModel
import com.mufeng.libs.base.BaseVMActivity
import com.mufeng.libs.utils.ktx.getString
import com.mufeng.libs.utils.ktx.toDateString
import com.mufeng.libs.utils.view.clickWithTrigger
import com.mufeng.libs.utils.view.visibleOrGone


/**
 *  余额提现结果页面
 */
class YueEeActivity : BaseVMActivity<YueEeViewModel, ActivityYueEeBinding>() {

    /**
     * 提现金额
     */
    private var money = ""

    /**
     * 提现方式
     */
    private var extract_type = ""

    /**
     * 服务费
     */
    private var serviceMoney = ""

    /**
     * 实际到账金额
     */
    private var finishMoney = ""

    /**
     * 违规扣除金额
     */
    private var deduction_money = ""

    override fun initView(savedInstanceState: Bundle?) {

        money = intent.getString("money")
        extract_type = intent.getString("extract_type")
        serviceMoney = intent.getString("serviceMoney")
        finishMoney = intent.getString("finishMoney")
        deduction_money = intent.getString("deduction_money")

        binding.appBar.ivBack.clickWithTrigger { finish() }
        binding.appBar.tvTitle.text = "余额提现"

        binding.tvMoney.text = "¥${money}"
        binding.tvPayment.text = "${extract_type}"
        binding.tvServiceMoney.text = "¥${serviceMoney}"
        binding.tvFinishMoney.text = "¥${finishMoney}"
        binding.tvTime.text = System.currentTimeMillis().toDateString()
        binding.tvConfirm.clickWithTrigger {
            finish()
        }

        binding.llDeductionMoney.visibleOrGone(deduction_money.toDoubleOrNull() != 0.0)
        binding.tvDeductionMoney.text = "¥${deduction_money}"
    }

    override fun initData() {
    }

    override fun startObserve() {
    }

}